using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LifeUI : MonoBehaviour
{
    public GameObject lifes;
    Image[] images;
    public int curIndex = 0;
    // Start is called before the first frame update
    void Start()
    {
        images = GetComponentsInChildren<Image>();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void CostHP()
    {
        curIndex = curIndex < 0 ? 0 : curIndex;
        images[curIndex++].enabled = false;
    }
}
